package com.xmall.sys.define.request.dict;

import com.xmall.define.base.BaseUpdateRequest;
import com.xmall.validate.group.AddGroup;
import com.xmall.validate.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 请求数据格式：新增/编辑 sys - dict
 */
@Data
public class DictUpdateRequest extends BaseUpdateRequest implements Serializable {

    /**
     * 字典名称
     */
    @NotBlank(message = "字典名称不能为空", groups = { AddGroup.class, UpdateGroup.class })
    @Min(value = 2, message = "字典名称长度最少 2 位")
    @Max(value = 20, message = "字典名称长度最多 20 位")
    private String name;

    /**
     * 字典编码
     */
    @NotBlank(message = "字典编码不能为空", groups = { AddGroup.class, UpdateGroup.class })
    @Min(value = 2, message = "字典编码长度最少 2 位")
    @Max(value = 20, message = "字典编码长度最多 20 位")
    private String code;

}
